home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / DJDEV203.ZIP / include / stdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-11-15  |  4.3 KB  |  154 lines

  1. /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
  2. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  3.  
  4. #ifndef __dj_include_stdio_h_
  5. #define __dj_include_stdio_h_
  6.  
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  12.  
  13. #include <sys/version.h>
  14. #include <sys/djtypes.h>
  15.   
  16. #define _IOFBF        00001
  17. #define _IONBF        00002
  18. #define _IOLBF        00004
  19.  
  20. /* Some programs think they know better... */
  21. #undef NULL
  22.  
  23. #define BUFSIZ        16384
  24. #define EOF        (-1)
  25. #define FILENAME_MAX    260
  26. #define FOPEN_MAX    20
  27. #define L_tmpnam    260
  28. #define NULL        0
  29. #define TMP_MAX        999999
  30.  
  31. #define SEEK_SET    0
  32. #define SEEK_CUR    1
  33. #define SEEK_END    2
  34.  
  35. __DJ_va_list
  36. #undef __DJ_va_list
  37. #define __DJ_va_list
  38. __DJ_size_t
  39. #undef __DJ_size_t
  40. #define __DJ_size_t
  41.  
  42. /* Note that the definitions of these fields are NOT guaranteed!  They
  43.    may change with any release without notice!  The fact that they
  44.    are here at all is to comply with ANSI specifictions. */
  45.    
  46. typedef struct {
  47.   int   _cnt;
  48.   char *_ptr;
  49.   char *_base;
  50.   int   _bufsiz;
  51.   int   _flag;
  52.   int   _file;
  53.   char *_name_to_remove;
  54.   int   _fillsize;
  55. } FILE;
  56.  
  57. typedef unsigned long        fpos_t;
  58.  
  59. extern FILE __dj_stdin, __dj_stdout, __dj_stderr;
  60. #define stdin    (&__dj_stdin)
  61. #define stdout    (&__dj_stdout)
  62. #define stderr    (&__dj_stderr)
  63.  
  64. void    clearerr(FILE *_stream);
  65. int    fclose(FILE *_stream);
  66. int    feof(FILE *_stream);
  67. int    ferror(FILE *_stream);
  68. int    fflush(FILE *_stream);
  69. int    fgetc(FILE *_stream);
  70. int    fgetpos(FILE *_stream, fpos_t *_pos);
  71. char *    fgets(char *_s, int _n, FILE *_stream);
  72. FILE *    fopen(const char *_filename, const char *_mode);
  73. int    fprintf(FILE *_stream, const char *_format, ...);
  74. int    fputc(int _c, FILE *_stream);
  75. int    fputs(const char *_s, FILE *_stream);
  76. size_t    fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
  77. FILE *    freopen(const char *_filename, const char *_mode, FILE *_stream);
  78. int    fscanf(FILE *_stream, const char *_format, ...);
  79. int    fseek(FILE *_stream, long _offset, int _mode);
  80. int    fsetpos(FILE *_stream, const fpos_t *_pos);
  81. long    ftell(FILE *_stream);
  82. size_t    fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
  83. int    getc(FILE *_stream);
  84. int    getchar(void);
  85. char *    gets(char *_s);
  86. void    perror(const char *_s);
  87. int    printf(const char *_format, ...);
  88. int    putc(int _c, FILE *_stream);
  89. int    putchar(int _c);
  90. int    puts(const char *_s);
  91. int    remove(const char *_filename);
  92. int    rename(const char *_old, const char *_new);
  93. void    rewind(FILE *_stream);
  94. int    scanf(const char *_format, ...);
  95. void    setbuf(FILE *_stream, char *_buf);
  96. int    setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
  97. int    sprintf(char *_s, const char *_format, ...);
  98. int    sscanf(const char *_s, const char *_format, ...);
  99. FILE *    tmpfile(void);
  100. char *    tmpnam(char *_s);
  101. int    ungetc(int _c, FILE *_stream);
  102. int    vfprintf(FILE *_stream, const char *_format, va_list _ap);
  103. int    vprintf(const char *_format, va_list _ap);
  104. int    vsprintf(char *_s, const char *_format, va_list _ap);
  105.  
  106. #ifndef __STRICT_ANSI__
  107.  
  108. #define L_ctermid
  109. #define L_cusrid
  110. /* #define STREAM_MAX    20 - DOS can change this */
  111.  
  112. int    fileno(FILE *_stream);
  113. FILE *    fdopen(int _fildes, const char *_type);
  114. int    pclose(FILE *_pf);
  115. FILE *    popen(const char *_command, const char *_mode);
  116.  
  117. #ifndef _POSIX_SOURCE
  118.  
  119. extern FILE __dj_stdprn, __dj_stdaux;
  120. #define stdprn    (&__dj_stdprn)
  121. #define stdaux    (&__dj_stdaux)
  122.  
  123. #define P_tmpdir "c:/"
  124.  
  125. void    _djstat_describe_lossage(FILE *_to_where);
  126. int    _doprnt(const char *_fmt, va_list _args, FILE *_f);
  127. int    _doscan(FILE *_f, const char *_fmt, void **_argp);
  128. int    _doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, void **_argp);
  129. int    fpurge(FILE *_f);
  130. int    getw(FILE *_f);
  131. int    mkstemp(char *_template);
  132. char *    mktemp(char *_template);
  133. int    putw(int _v, FILE *_f);
  134. void    setbuffer(FILE *_f, void *_buf, int _size);
  135. void    setlinebuf(FILE *_f);
  136. char *    tempnam(const char *_dir, const char *_prefix);
  137. int    _rename(const char *_old, const char *_new);    /* Simple (no directory) */
  138. int    vfscanf(FILE *_stream, const char *_format, va_list _ap);
  139. int    vscanf(const char *_format, va_list _ap);
  140. int    vsscanf(const char *_s, const char *_format, va_list _ap);
  141.  
  142. #endif /* !_POSIX_SOURCE */
  143. #endif /* !__STRICT_ANSI__ */
  144. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  145.  
  146. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  147. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  148.  
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152.  
  153. #endif /* !__dj_include_stdio_h_ */
  154.